<!--
 * @Descripttion:
 * @version:
 * @Author: zhuzm@linkstec.com
 * @Date: 2023-01-09 15:01:06
 * @LastEditors: sueRimn
 * @LastEditTime: 2023-03-28 13:32:19
-->
<template>
  <el-row :gutter="20" class="search-list-discover">
    <el-col :span="12" v-for="(item, index) in dataFilter" :key="index">
      <div class="list-item" @click="jump(item)">
        <div class="name" v-html="item.detail.first_tab_v"></div>
        <div class="desc">{{ item.detail.second_tab }}</div>
      </div>
    </el-col>
  </el-row>
</template>
<script>
export default {
  props: {
    data: {
      type: Array,
      default: () => {
        return [];
      }
    },
    max: {
      type: Number,
      default: Infinity
    }
  },
  methods: {
    jump (item) {
      window.location.href = item.detail.direct_url;
    }
  },
  computed: {
    dataFilter () {
      if (this.max === Infinity) return this.data;
      return this.data.slice(0, this.max);
    }
  }
};
</script>
<style lang="scss" scoped>
@import './common.scss';
.search-list-discover{
  padding-right: 8px;
  .list-item{
    height: 60px;
    background: linear-gradient(180deg, #F2F6FD 2.66%, #FFFEFE 100%);
    border: 1px solid #E1E5EE;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    div{
      margin-left: 16px;
    }
    .desc{
      font-weight: 400;
      font-size: 14px;
      line-height: 21px;
      color: #9B9494;
    }
    &:hover{
      border-color: #2468F2;
    }
  }
}
</style>
